﻿#include "KeyBindSettings.h"
#include "Forms/Client.CMain.h"

using namespace Client::MirSounds;

namespace Client
{

InIReader *KeyBindSettings::Reader = new InIReader(R"(.\KeyBinds.ini)");

    KeyBindSettings::KeyBindSettings()
    {
        New(Keylist);
        New(DefaultKeylist);

        if (!FileSystem::fileExists(R"(.\KeyBinds.ini)"))
        {
            Save();
            return;
        }

        Load();
    }

    void KeyBindSettings::Load()
    {
        for (auto Inputkey : Keylist)
        {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Inputkey->RequireAlt = Reader->ReadByte(Inputkey->function.ToString(), "RequireAlt", Inputkey->RequireAlt);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Inputkey->RequireShift = Reader->ReadByte(Inputkey->function.ToString(), "RequireShift", Inputkey->RequireShift);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Inputkey->RequireTilde = Reader->ReadByte(Inputkey->function.ToString(), "RequireTilde", Inputkey->RequireTilde);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Inputkey->RequireCtrl = Reader->ReadByte(Inputkey->function.ToString(), "RequireCtrl", Inputkey->RequireCtrl);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            std::string Input = Reader->ReadString(Inputkey->function.ToString(), "RequireKey", Inputkey->Key->ToString());
            Enum::TryParse(Input, Inputkey->Key);

        }
    }

    void KeyBindSettings::Save()
    {
        Reader->Write("Guide", "01", "RequireAlt,RequireShift,RequireTilde,RequireCtrl");
        Reader->Write("Guide", "02", "have 3 options: 0/1/2");
        Reader->Write("Guide", "03", "0 < you cannot have this key pressed to use the function");
        Reader->Write("Guide", "04", "1 < you have to have this key pressed to use this function");
        Reader->Write("Guide", "05", "2 < it doesnt matter if you press this key to use this function");
        Reader->Write("Guide", "06", "by default just use 2, unless you have 2 functions on the same key");
        Reader->Write("Guide", "07", "example: change attack mode (ctrl+h) and help (h)");
        Reader->Write("Guide", "08", "if you set either of those to requireshift 2, then they wil both work at the same time or not work");
        Reader->Write("Guide", "09", "");
        Reader->Write("Guide", "10", "To get the value for RequireKey look at:");
        Reader->Write("Guide", "11", "https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx");

        for (auto Inputkey : Keylist)
        {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Reader->Write(Inputkey->function.ToString(), "RequireAlt", Inputkey->RequireAlt);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Reader->Write(Inputkey->function.ToString(), "RequireShift", Inputkey->RequireShift);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Reader->Write(Inputkey->function.ToString(), "RequireTilde", Inputkey->RequireTilde);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Reader->Write(Inputkey->function.ToString(), "RequireCtrl", Inputkey->RequireCtrl);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            Reader->Write(Inputkey->function.ToString(), "RequireKey", Inputkey->Key->ToString());
        }
    }

    void KeyBindSettings::New(std::vector<KeyBind*> &list)
    {
        KeyBind *InputKey;
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Inventory Open/Close";
        InputKey->function = KeybindOptions::Inventory;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->F9;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Inventory Open/Close Alt";
        InputKey->function = KeybindOptions::Inventory2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->I;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Equipment Open/Close";
        InputKey->function = KeybindOptions::Equipment;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->F10;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Equipment Open/Close Alt";
        InputKey->function = KeybindOptions::Equipment2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->C;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Skills Open/Close";
        InputKey->function = KeybindOptions::Skills;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->F11;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Skills Open/Close Alt";
        InputKey->function = KeybindOptions::Skills2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->S;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Creatures Open/Close";
        InputKey->function = KeybindOptions::Creature;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->E;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Mount Open/Close";
        InputKey->function = KeybindOptions::MountWindow;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->J;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Fishing Open/Close";
        InputKey->function = KeybindOptions::Fishing;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->N;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Skillbar Open/Close";
        InputKey->function = KeybindOptions::Skillbar;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->R;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Mentor Open/Close";
        InputKey->function = KeybindOptions::Mentor;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Relationship Open/Close";
        InputKey->function = KeybindOptions::Relationship;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->L;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Friends Open/Close";
        InputKey->function = KeybindOptions::Friends;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->F;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Guild Open/Close";
        InputKey->function = KeybindOptions::Guilds;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->G;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Gameshop Open/Close";
        InputKey->function = KeybindOptions::GameShop;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Y;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Quest Diary Open/Close";
        InputKey->function = KeybindOptions::Quests;
        InputKey->RequireAlt = 0;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Q;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Options Open/Close";
        InputKey->function = KeybindOptions::Options;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->F12;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Options Open/Close Alt";
        InputKey->function = KeybindOptions::Options2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->O;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Group Open/Close";
        InputKey->function = KeybindOptions::Group;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->P;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Belt Open/Close";
        InputKey->function = KeybindOptions::Belt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->Z;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Minimap Open/Close";
        InputKey->function = KeybindOptions::Minimap;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->V;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Bigmap Open/Close";
        InputKey->function = KeybindOptions::Bigmap;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->B;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Ranking Open/Close";
        InputKey->function = KeybindOptions::Ranking;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->K;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Help Open/Close";
        InputKey->function = KeybindOptions::Help;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 0;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->H;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Keybinds Open/Close";
        InputKey->function = KeybindOptions::Keybind;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->U;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Dialogs";
        InputKey->Description = "Close All Windows";
        InputKey->function = KeybindOptions::Closeall;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Escape;
        list.push_back(InputKey);

        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 1";
        InputKey->function = KeybindOptions::Bar1Skill1;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F1;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 2";
        InputKey->function = KeybindOptions::Bar1Skill2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F2;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 3";
        InputKey->function = KeybindOptions::Bar1Skill3;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F3;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 4";
        InputKey->function = KeybindOptions::Bar1Skill4;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F4;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 5";
        InputKey->function = KeybindOptions::Bar1Skill5;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F5;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 6";
        InputKey->function = KeybindOptions::Bar1Skill6;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F6;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 7";
        InputKey->function = KeybindOptions::Bar1Skill7;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F7;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Slot 8";
        InputKey->function = KeybindOptions::Bar1Skill8;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->F8;
        list.push_back(InputKey);

        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 1";
        InputKey->function = KeybindOptions::Bar2Skill1;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F1;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 2";
        InputKey->function = KeybindOptions::Bar2Skill2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F2;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 3";
        InputKey->function = KeybindOptions::Bar2Skill3;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F3;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 4";
        InputKey->function = KeybindOptions::Bar2Skill4;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F4;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 5";
        InputKey->function = KeybindOptions::Bar2Skill5;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F5;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 6";
        InputKey->function = KeybindOptions::Bar2Skill6;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F6;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 7";
        InputKey->function = KeybindOptions::Bar2Skill7;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F7;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Skillbar";
        InputKey->Description = "Skillbar Alt Slot 8";
        InputKey->function = KeybindOptions::Bar2Skill8;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 0;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->F8;
        list.push_back(InputKey);

        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Rotate Belt";
        InputKey->function = KeybindOptions::BeltFlip;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->Z;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 1";
        InputKey->function = KeybindOptions::Belt1;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D1;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 1 Alt";
        InputKey->function = KeybindOptions::Belt1Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad1;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 2";
        InputKey->function = KeybindOptions::Belt2;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D2;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 2 Alt";
        InputKey->function = KeybindOptions::Belt2Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad2;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 3";
        InputKey->function = KeybindOptions::Belt3;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D3;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 3 Alt";
        InputKey->function = KeybindOptions::Belt3Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad3;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 4";
        InputKey->function = KeybindOptions::Belt4;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D4;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 4 Alt";
        InputKey->function = KeybindOptions::Belt4Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad4;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 5";
        InputKey->function = KeybindOptions::Belt5;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D5;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 5 Alt";
        InputKey->function = KeybindOptions::Belt5Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad5;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 6";
        InputKey->function = KeybindOptions::Belt6;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D6;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Belt";
        InputKey->Description = "Belt Slot 6 Alt";
        InputKey->function = KeybindOptions::Belt6Alt;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->NumPad6;
        list.push_back(InputKey);

        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Logout";
        InputKey->function = KeybindOptions::Logout;
        InputKey->RequireAlt = 1;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->X;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Exit";
        InputKey->function = KeybindOptions::Exit;
        InputKey->RequireAlt = 1;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Q;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Mount/Dismount";
        InputKey->function = KeybindOptions::Mount;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->M;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Pickup Floor Item";
        InputKey->function = KeybindOptions::Pickup;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Tab;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Creature Item Pickup";
        InputKey->function = KeybindOptions::CreaturePickup;
        InputKey->RequireAlt = 0;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->X;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Creature Auto Pickup";
        InputKey->function = KeybindOptions::CreatureAutoPickup;
        InputKey->RequireAlt = 1;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 0;
        InputKey->Key = Keys->A;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Request Trade";
        InputKey->function = KeybindOptions::Trade;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->T;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "General";
        InputKey->Description = "Recruit Group Member";
        InputKey->function = KeybindOptions::AddGroupMember;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->G;
        list.push_back(InputKey);

        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Toggle Attack Mode";
        InputKey->function = KeybindOptions::ChangeAttackmode;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 0;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->H;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : Peace";
        InputKey->function = KeybindOptions::AttackmodePeace;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : Group";
        InputKey->function = KeybindOptions::AttackmodeGroup;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : Guild";
        InputKey->function = KeybindOptions::AttackmodeGuild;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : Enemy Guild";
        InputKey->function = KeybindOptions::AttackmodeEnemyguild;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : Red/Brown";
        InputKey->function = KeybindOptions::AttackmodeRedbrown;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Attack Mode : All";
        InputKey->function = KeybindOptions::AttackmodeAll;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Toggle Pet Mode";
        InputKey->function = KeybindOptions::ChangePetmode;
        InputKey->RequireAlt = 0;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 1;
        InputKey->Key = Keys->A;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Pet Mode : Both";
        InputKey->function = KeybindOptions::PetmodeBoth;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Pet Mode : Move Only";
        InputKey->function = KeybindOptions::PetmodeMoveonly;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Pet Mode : Attack Only";
        InputKey->function = KeybindOptions::PetmodeAttackonly;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Set Pet Mode : None";
        InputKey->function = KeybindOptions::PetmodeNone;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->None;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Toggle Autorun";
        InputKey->function = KeybindOptions::Autorun;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->D;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Toggle Camera Mode";
        InputKey->function = KeybindOptions::Cameramode;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Insert;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Take Screenshot";
        InputKey->function = KeybindOptions::Screenshot;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->PrintScreen;
        list.push_back(InputKey);
        InputKey = new KeyBind();
        InputKey->Group = "Toggle";
        InputKey->Description = "Toggle Dropview";
        InputKey->function = KeybindOptions::DropView;
        InputKey->RequireAlt = 2;
        InputKey->RequireShift = 2;
        InputKey->RequireTilde = 2;
        InputKey->RequireCtrl = 2;
        InputKey->Key = Keys->Tab;
        list.push_back(InputKey);

//C# TO C++ CONVERTER TODO TASK: A 'delete InputKey' statement was not added since InputKey was passed to a method or constructor. Handle memory management manually.
    }

    std::string KeyBindSettings::GetKey(KeybindOptions Option, bool defaultKey)
    {
        std::vector<KeyBind*> lst;

        if (defaultKey)
        {
            lst = CMain::InputKeys->DefaultKeylist;
        }
        else
        {
            lst = CMain::InputKeys->Keylist;
        }

        std::string output = "";
        for (int i = 0; i < lst.size(); i++)
        {
            if (lst[i]->function == Option)
            {
                if (lst[i]->Key == Keys->None)
                {
                    return output;
                }
                if (lst[i]->RequireAlt == 1)
                {
                    output = "Alt";
                }
                if (lst[i]->RequireCtrl == 1)
                {
                    output = output != "" ? output + " + Ctrl" : "Ctrl";
                }
                if (lst[i]->RequireShift == 1)
                {
                    output = output != "" ? output + " + Shift" : "Shift";
                }
                if (lst[i]->RequireTilde == 1)
                {
                    output = output != "" ? output + " + ~" : "~";
                }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                output = output != "" ? output + " + " + lst[i]->Key->ToString() : lst[i]->Key->ToString();
                return output;
            }
        }
        return "";
    }
}
